#Output for methratio file
methratio="/Volumes/web/Mollusk/bs_larvae_exp/AdapterTrimmed_methratio_files/"
#Location of filtered files
filtered="/Volumes/web/Mollusk/bs_larvae_exp/AdapterTrimmed_FilteredFiles/"
#command for only obtaining the context '__CG_'
!grep "[A-Z][A-Z]CG[A-Z]" <{methratio}methratio_out_M1.txt> {filtered}methratio_out_CG_M1.txt
#obtaining a filtered file with at least 5x coverage
!awk '{if ($8 >= 5) print $1,$2,$3,$4,$5,$6,$7,$8,$9,$10,$11,$12}' </Volumes/web/Mollusk/bs_larvae_exp/AdapterTrimmed_FilteredFiles/methratio_out_CG_M1.txt> /Volumes/web/Mollusk/bs_larvae_exp/AdapterTrimmed_FilteredFiles/methratio_out_CG5x_M1.txt
!tr ' ' "\t" </Volumes/web/Mollusk/bs_larvae_exp/AdapterTrimmed_FilteredFiles/methratio_out_CG5x_M1.txt> /Volumes/web/Mollusk/bs_larvae_exp/AdapterTrimmed_FilteredFiles/methratio_out_CG5x_M1_tab.txt
#command for only obtaining the context '__CG_'
!grep "[A-Z][A-Z]CG[A-Z]" <{methratio}methratio_out_M3.txt> {filtered}methratio_out_CG_M3.txt
#obtaining a filtered file with at least 5x coverage
!awk '{if ($8 >= 5) print $1,$2,$3,$4,$5,$6,$7,$8,$9,$10,$11,$12}' </Volumes/web/Mollusk/bs_larvae_exp/AdapterTrimmed_FilteredFiles/methratio_out_CG_M3.txt> /Volumes/web/Mollusk/bs_larvae_exp/AdapterTrimmed_FilteredFiles/methratio_out_CG5x_M3.txt
!tr ' ' "\t" </Volumes/web/Mollusk/bs_larvae_exp/AdapterTrimmed_FilteredFiles/methratio_out_CG5x_M3.txt> /Volumes/web/Mollusk/bs_larvae_exp/AdapterTrimmed_FilteredFiles/methratio_out_CG5x_M3_tab.txt
#command for only obtaining the context '__CG_'
!grep "[A-Z][A-Z]CG[A-Z]" <{methratio}methratio_out_T1D3.txt> {filtered}methratio_out_CG_T1D3.txt
#obtaining a filtered file with at least 5x coverage
!awk '{if ($8 >= 5) print $1,$2,$3,$4,$5,$6,$7,$8,$9,$10,$11,$12}' </Volumes/web/Mollusk/bs_larvae_exp/AdapterTrimmed_FilteredFiles/methratio_out_CG_T1D3.txt> /Volumes/web/Mollusk/bs_larvae_exp/AdapterTrimmed_FilteredFiles/methratio_out_CG5x_T1D3.txt
!tr ' ' "\t" </Volumes/web/Mollusk/bs_larvae_exp/AdapterTrimmed_FilteredFiles/methratio_out_CG5x_T1D3.txt> /Volumes/web/Mollusk/bs_larvae_exp/AdapterTrimmed_FilteredFiles/methratio_out_CG5x_T1D3_tab.txt
#command for only obtaining the context '__CG_'
!grep "[A-Z][A-Z]CG[A-Z]" <{methratio}methratio_out_T1D5.txt> {filtered}methratio_out_CG_T1D5.txt
#obtaining a filtered file with at least 5x coverage
!awk '{if ($8 >= 5) print $1,$2,$3,$4,$5,$6,$7,$8,$9,$10,$11,$12}' </Volumes/web/Mollusk/bs_larvae_exp/AdapterTrimmed_FilteredFiles/methratio_out_CG_T1D5.txt> /Volumes/web/Mollusk/bs_larvae_exp/AdapterTrimmed_FilteredFiles/methratio_out_CG5x_T1D5.txt
!tr ' ' "\t" </Volumes/web/Mollusk/bs_larvae_exp/AdapterTrimmed_FilteredFiles/methratio_out_CG5x_T1D5.txt> /Volumes/web/Mollusk/bs_larvae_exp/AdapterTrimmed_FilteredFiles/methratio_out_CG5x_T1D5_tab.txt
#command for only obtaining the context '__CG_'
!grep "[A-Z][A-Z]CG[A-Z]" <{methratio}methratio_out_T3D3.txt> {filtered}methratio_out_CG_T3D3.txt
#obtaining a filtered file with at least 5x coverage
!awk '{if ($8 >= 5) print $1,$2,$3,$4,$5,$6,$7,$8,$9,$10,$11,$12}' </Volumes/web/Mollusk/bs_larvae_exp/AdapterTrimmed_FilteredFiles/methratio_out_CG_T3D3.txt> /Volumes/web/Mollusk/bs_larvae_exp/AdapterTrimmed_FilteredFiles/methratio_out_CG5x_T3D3.txt
!tr ' ' "\t" </Volumes/web/Mollusk/bs_larvae_exp/AdapterTrimmed_FilteredFiles/methratio_out_CG5x_T3D3.txt> /Volumes/web/Mollusk/bs_larvae_exp/AdapterTrimmed_FilteredFiles/methratio_out_CG5x_T3D3_tab.txt
#command for only obtaining the context '__CG_'
!grep "[A-Z][A-Z]CG[A-Z]" <{methratio}methratio_out_T3D5.txt> {filtered}methratio_out_CG_T3D5.txt
#obtaining a filtered file with at least 5x coverage
!awk '{if ($8 >= 5) print $1,$2,$3,$4,$5,$6,$7,$8,$9,$10,$11,$12}' </Volumes/web/Mollusk/bs_larvae_exp/AdapterTrimmed_FilteredFiles/methratio_out_CG_T3D5.txt> /Volumes/web/Mollusk/bs_larvae_exp/AdapterTrimmed_FilteredFiles/methratio_out_CG5x_T3D5.txt
!tr ' ' "\t" </Volumes/web/Mollusk/bs_larvae_exp/AdapterTrimmed_FilteredFiles/methratio_out_CG5x_T3D5.txt> /Volumes/web/Mollusk/bs_larvae_exp/AdapterTrimmed_FilteredFiles/methratio_out_CG5x_T3D5_tab.txt
#NOTEBOOK NAME
nb='Filtering_Larvae_AdapterTrimmed'
#NOTEBOOK LOCATION
nbloc='/Users/claireolson/Dropbox/Lab\ \(1\)/IPython_nbs/Claire/'
#TIMESTAMP
date=!date +%m%d_%H%M
#LOCATION OF POST DIRECTORY
post='/Volumes/web/Mollusk/iPython_Posts/'
cd {post}
!ipython nbconvert {nbloc}{nb} --to html --template full --output {nb}{date}